package com.murphy.algorithm.likou;

/**
 * F(n)=F(n-1)+F(n-2)
 * @author dongsufeng
 * @version 4.0
 * @date 2023/2/23 15:33
 */
public class Fib {

    public int fib(int n){
        if (n==0 ||n==1){
            return n;
        }
        return fib(n-1)+fib(n-2);
    }

    public static void main(String[] args) {
        Fib fib = new Fib();
        System.out.println(fib.fib(2));
    }
}
